

using System;
using System.Collections.Generic;
using System.Text;

namespace JTC.MiniCommerce.Store.Services.PaymentService {
  public interface IPaymentProvider {

    #region Generic Gateway Methods

    /// <summary>
    /// Authorizes the specified order.
    /// </summary>
    /// <param name="order">The order.</param>
    /// <returns></returns>
    Transaction Authorize(Order order);

    /// <summary>
    /// Charges the specified order.
    /// </summary>
    /// <param name="order">The order.</param>
    /// <returns></returns>
    Transaction Charge(Order order);

    /// <summary>
    /// Refunds the specified transaction.
    /// </summary>
    /// <param name="transaction">The transaction.</param>
    /// <returns></returns>
    Transaction Refund(Transaction transaction);

    #endregion

    #region PayPal Standard

    /// <summary>
    /// Creates the cart URL.
    /// </summary>
    /// <param name="order">The order.</param>
    /// <returns></returns>
    string CreateCartUrl(Order order, string returnUrl, string cancelUrl);

    /// <summary>
    /// Synchronizes the specified args.
    /// </summary>
    /// <param name="args">The args.</param>
    /// <returns></returns>
    string Synchronize(params object[] args);

    #endregion

    #region PayPal Express

    /// <summary>
    /// Sets the express checkout.
    /// </summary>
    /// <param name="order">The order.</param>
    /// <param name="returnUrl">The return URL.</param>
    /// <param name="cancelUrl">The cancel URL.</param>
    /// <param name="authorizeOnly">if set to <c>true</c> [authorize only].</param>
    /// <returns></returns>
    string SetExpressCheckout(Order order, string returnUrl, string cancelUrl, bool authorizeOnly);

    /// <summary>
    /// Gets the express checkout details.
    /// </summary>
    /// <param name="token">The token.</param>
    /// <returns></returns>
    PayPalPayer GetExpressCheckoutDetails(string token);

    /// <summary>
    /// Does the express checkout.
    /// </summary>
    /// <param name="order">The order.</param>
    /// <param name="authorizeOnly">if set to <c>true</c> [authorize only].</param>
    /// <returns></returns>
    Transaction DoExpressCheckout(Order order, bool authorizeOnly);

    #endregion

  }
}
